package com.boot.persistence.controller.association;

import com.boot.persistence.model.BaseModel;
import com.boot.web.http.HttpModel;
import org.springframework.http.ResponseEntity;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * @author 霜寒 <1621856595@qq.com>
 * @description 多对多关联查询控制层对内接口
 * @date 2019/11/13 15:42
 **/

public interface IAssociationController<Mid extends Serializable, Nid extends Serializable,
        M extends BaseModel<Mid>, N extends BaseModel<Nid>> {

    ResponseEntity<HttpModel<Collection<N>>> m2n(Mid mid);

    ResponseEntity<HttpModel<Collection<N>>> m2n(@NotEmpty List<Mid> mids);

    ResponseEntity<HttpModel<Collection<M>>> n2m(Nid nid);

    ResponseEntity<HttpModel<Collection<M>>> n2m(@NotEmpty List<Nid> nids);
}
